package chixing.day08.static_demo;

import static java.lang.Class.forName;

public class StudentTest {
    public static void main(String[] args) throws ClassNotFoundException {
        //jvm加载student类
        //类加载时执行且 只执行一次，  创建对象可以创建多个，
        //执行static代码块按顺序依次执行
//            Class.forName("chixing.day08.static_demo.Student");
//            Class.forName("chixing.day08.static_demo.Student");
//            Class.forName("chixing.day08.static_demo.Student");

            Student student = new Student();//创建对象时自动加载类


//        Student stu1 = new Student();
//        //对象名.属性名
//        stu1.stuNo=1;
//        stu1.stuName="aaa";
//        stu1.stuTel=139439541L;
//
//        Student stu2 = new Student();
//        stu2.stuNo=1;
//        stu2.stuName="bbb";
//        stu2.stuTel=1165439541L;
//
//        //类名.属性名
//        String schoolName = Student.schoolName;
//
//        System.out.println(stu1.schoolName);
//        System.out.println(stu2.schoolName);
//
//        Student.schoolName="商丘学院";
//        System.out.println(stu1.schoolName);
//        System.out.println(stu2.schoolName);

    }
}
